﻿namespace Devonline.AspNetCore;

/// <summary>
/// 图片缩放服务接口
/// </summary>
public interface IImageResizeService
{
    /// <summary>
    /// 根据指定分辨率获取缩放后的文件名
    /// </summary>
    /// <param name="fileName">原始文件名</param>
    /// <param name="width">宽度</param>
    /// <param name="height">高度</param>
    /// <returns></returns>
    /// <exception cref="DirectoryNotFoundException"></exception>
    string GetResizeFileName(string fileName, int width, int height);
    /// <summary>
    /// 制作图片文件裁剪图, 当且仅当只有原图片尺寸大于裁剪图尺寸时才会生成裁剪图
    /// </summary>
    /// <param name="fileName">图片对象</param>
    /// <param name="width">最大宽度</param>
    /// <param name="height">最大高度</param>
    /// <exception cref="FileNotFoundException"></exception>
    string Resize(string fileName, int width, int height);
}